package com.distribute.framework.dao;

import java.util.List;
import java.util.Map;

import com.distribute.framework.core.util.Function;
import com.distribute.framework.core.web.util.Page;
import com.distribute.framework.model.BindingDistributor;

/**
 * 绑定配送商的Dao接口
 * @author 刘代应
 */
@SuppressWarnings("unchecked")
public interface IBindingDistributorDao
{
	/**
	 * 获取所有绑定配送商
	 * @return
	 */
	public List<BindingDistributor> getBindingDistributorList(Map params,Integer offset,Integer size);

	/**
	 * 获取绑定配送商统计
	 * @return
	 */
	public List getBindingDistributorStats(Map params,Map<String,Object> groups,Map<String,Object> sums);

	/**
	 * 获取绑定配送商总数
	 * @return
	 */	
	public Long getBindingDistributorCount(Map params);
	
	/**
	 * 获取绑定配送商自定义求和表达式,比如求和:eval="sum(id)"
	 * @return
	 */	
	public <T> T getBindingDistributorEval(String eval,Map params);
	
	/**
	 * 获取绑定配送商分页
	 * @return
	 */	
	public Page getBindingDistributorPage(int page,int size,Map params);
	
	/**
	 * 根据查询条件取绑定配送商
	 * @param params
	 * @return
	 */
	public BindingDistributor getBindingDistributor(Map params);	

	/**
	 * 根据ID取绑定配送商
	 * @param id
	 * @return
	 */
	public BindingDistributor getBindingDistributorById(Long id);


	
	

	/**
	 * 保存绑定配送商
	 * @param bindingDistributor
	 */
	public BindingDistributor saveBindingDistributor(BindingDistributor bindingDistributor);

	/**
	 * 更新绑定配送商
	 * @param bindingDistributor
	 */
	public int updateBindingDistributor(BindingDistributor bindingDistributor);
	/**
	 * 更新绑定配送商非空字段
	 * @param bindingDistributor
	 */
	public int updateBindingDistributor$NotNull(BindingDistributor bindingDistributor);

	/**
	 * 根据ID删除一个绑定配送商
	 * @param id
	 */
	public void deleteBindingDistributorById(Long id);
	
	/**
	 * 根据ID逻辑删除一个绑定配送商
	 * @param id
	 */
	public void removeBindingDistributorById(Long id);
	
	/**
	 * 根据条件更新绑定配送商
	 * @param values
	 * @param params
	 */
	public int updateBindingDistributorByConfirm(Map values, Map params);
	/**
	 * 根据条件删除绑定配送商
	 * @param params
	 */
	public void deleteBindingDistributorByConfirm(Map params);
	
	/**
	 * 执行过程，以便事务回滚
	 * @param function
	 */
	public <T> T executeTransaction(Function function);

}